from otree.api import *

doc = """
学号
"""


class C(BaseConstants):
    NAME_IN_URL = 'gfs'
    PLAYERS_PER_GROUP = None
    NUM_ROUNDS = 1
    TABLE_STYLE = """
<style>
        img {
            width: auto;
            height: 300px;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            margin: 20px 0; /* 适当减小表格的上下外边距，更适合手机布局 */
            font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif; /* 选择适合中文显示的字体 */
            min-width: 280px; /* 减小最小宽度，适应手机屏幕 */
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* 调小阴影范围 */
        }

        th {
            background-color: #f2f2f2;
            color: #333;
            text-align: left;
            padding: 10px 12px; /* 适当减小内边距，节省空间 */
            font-size: 16px; /* 设置适合手机阅读的字体大小 */
        }

        caption {
            padding: 8px; /* 减小标题内边距 */
            caption-side: bottom;
            color: #777;
            font-size: 14px; /* 调整标题字体大小 */
            margin-top: 8px;
        }

        td {
            padding: 10px 12px; /* 适当减小内边距，节省空间 */
            text-align: left;
            font-size: 14px; /* 设置适合手机阅读的字体大小 */
        }

        tr:nth-child(even) td {
            background-color: #f2f2f2;
        }

        tr:nth-child(odd) td {
            background-color: #fff;
        }

        tr:hover td {
            background-color: #e9f3ff;
        }

        th,
        td {
            border: 1px solid #e0e0e0;
        }
    </style>
    """


class Subsession(BaseSubsession):
    pass


class Group(BaseGroup):
    pass


class Player(BasePlayer):
    payer_no = models.IntegerField(label="请输入您的学号")


# PAGES
class Start(Page):
    pass


class Next(Page):
    pass


class PlayerNo(Page):
    form_model = 'player'
    form_fields = ['payer_no']


page_sequence = [
    Start,
    PlayerNo,
    Next,
]
